import React from 'react';
import { Select } from 'antd';

import { ValueListOptionPropsType } from '../typeConfig';

const { Option } = Select;

const ValueList: React.FunctionComponent<any> = (props) => {

  const { options = [], style = {}, ...other } = props;

  return (
    <>
      <Select {...other} style={style}>
        {options.map((item: ValueListOptionPropsType) => {
          return <Option key={item.value} value={item.value}>{item.meaning}</Option>
        })}
      </Select>
    </>
  );
}

export default ValueList;